local joy__tuodao = fk.CreateSkill {

  name = "joy__tuodao",

  tags = { Skill.Compulsory, },

}



joy__tuodao:addEffect(fk.CardUseFinished, {
  name = "joy__tuodao",
  anim_type = "offensive",
  frequency = Skill.Compulsory,
  events = {fk.CardUseFinished, fk.CardRespondFinished},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(joy__tuodao.name) and data.card.name == "jink"
  end,
  on_use = function(self, event, target, player, data)
    player.room:addPlayerMark(player, "@joy__tuodao")
  end,
})
joy__tuodao:addEffect(fk.CardRespondFinished, {
  name = "joy__tuodao",
  anim_type = "offensive",
  frequency = Skill.Compulsory,
  events = {fk.CardUseFinished, fk.CardRespondFinished},
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(joy__tuodao.name) and data.card.name == "jink"
  end,
  on_use = function(self, event, target, player, data)
    player.room:addPlayerMark(player, "@joy__tuodao")
  end,
})
joy__tuodao:addEffect(fk.CardUsing, {
  refresh_events = {fk.CardUsing},
  can_refresh = function (self, event, target, player, data)
    return player == target and data.card.trueName == "slash" and player:getMark("@joy__tuodao") > 0
  end,
  on_refresh = function (self, event, target, player, data)
    data.additionalDamage = (data.additionalDamage or 0) + player:getMark("@joy__tuodao")
    player.room:setPlayerMark(player, "@joy__tuodao", 0)
  end,
})

return joy__tuodao